package com.jacobson.huobi.mvp.presenter

import com.jacobson.core.di.annotation.ActivityScope
import com.jacobson.core.mvp.BasePresenter
import com.jacobson.huobi.common.expansion.applySchedulersIoMain
import com.jacobson.huobi.common.expansion.onRespResult
import com.jacobson.huobi.mvp.contract.AlarmRecordContract
import javax.inject.Inject

@ActivityScope
class AlarmRecordPresenter @Inject constructor(
    view: AlarmRecordContract.View,
    model: AlarmRecordContract.Model
) : BasePresenter<AlarmRecordContract.View, AlarmRecordContract.Model>(view, model),
    AlarmRecordContract.Presenter {
    override fun loadSymbolRecordList(
        market: String,
        symbol: String,
        strategy: Int,
        period: String,
        lastTs: Long?
    ) {
        model.loadSymbolRecordList(market, symbol, strategy, period, lastTs)
            .applySchedulersIoMain()
            .onRespResult(view) { resp ->
                view?.onSymbolRecordResp(resp)
            }
    }


}
